/**
 * @filename:DeviceRunLogDao 2020年11月16日
 * @project   V1.0
 * Copyright(c) 2020 caoshuai Co. Ltd. 
 * All right reserved. 
 */
package com.itlong.cloud.operate.dao;

import com.itlong.cloud.POJO.DTO.property.CloudIntercomChangeLogGetDTO;
import com.itlong.cloud.POJO.PO.DeviceRunLogPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**   
 *
 * <p>说明： 设备运行日志数据访问层</p>
 * @version: V1.0
 * @author: caoshuai
 * 
 */
@Mapper
@Repository
public interface IDeviceRunLogDao {

    /**
     * <desc>
     *      根据设设备运行日志ID获取设备日志运行信息
     * </desc>
     *
     * @param runLogId 设备运行日志ID
     * @return DeviceRunLogPO
     * @author caoshuai
     * @createDate 2020/11/16 11:04
     */
    DeviceRunLogPO getDeviceRunLogInfo(@Param("runLogId") String runLogId);

    /**
     * <desc>
     *      根据运行日志逻辑ID删除运行日志
     * </desc>
     *
     * @param runLogId 运行日志逻辑ID
     * @return
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    Integer delRunLogById(String runLogId);


    /**
     * <desc>
     *      保存
     * <desc/>
     *
     * @param params 保存信息
     * @return sql执行行数
     * @author caoshuai
     * @createDate 2020/12/3 14:01
     */
    Integer save(Map<String, Object> params);

    /**
     * <desc>
     *      根据deviceUnique 获取sn
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 19:13
     */
    String getIntercomSnByDeviceUnique(String deviceUnique);

    /**
     * <desc>
     *      根据设备id修改
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 19:13
     */
    Integer update(DeviceRunLogPO deviceRunLogPO);

    /**
     * <desc>
     * 获取受限getDTO 获取受限设备总数
     * </desc>
     *
     * @param getDTO
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 14:17
     */
    Integer getLimitDeviceTotalByDTO(CloudIntercomChangeLogGetDTO getDTO);

    /**
     * <desc>
     * 获取平板受限设备总数
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/12/3 14:17
     */
    Integer getLimitDevicePadTotalBy(@Param("deviceUnique") String deviceUnique);
    /**
     * <desc>
     *      获取当天日志
     * </desc>
     *
     *
     * @author maju
     * @createDate 2021/4/27
     * @param ids
     */
    List<DeviceRunLogPO> getDeviceRunLogInfoToDay(@Param("ids") Set<Integer> ids);

}
